//
//  PKReadDetailTableViewCell.m
//  PianKe
//
//  Created by lanou on 15/12/28.
//  Copyright (c) 2015年 KFC. All rights reserved.
//

#import "PKReadDetailTableViewCell.h"




@implementation PKReadDetailTableViewCell




- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        [self addSubViews];
        
    }
    
    
    return self
    ;
}


- (void)addSubViews
{
    _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, kScreenWidth - 20, 30)];
    //_titleLabel.backgroundColor = [UIColor redColor];
    _titleLabel.numberOfLines = 0;
    _titleLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:_titleLabel];
    
    _coverImageV = [[UIImageView alloc]initWithFrame:CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.size.height + _titleLabel.frame.origin.y + 15, _titleLabel.frame.size.width / 2, 80)];
    //_coverImageV.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:_coverImageV];
    
    _contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(_coverImageV.right + 5, _coverImageV.top, _titleLabel.frame.size.width / 2, _coverImageV.height)];
    /// _contentLabel.backgroundColor = [UIColor orangeColor];
    _contentLabel.numberOfLines = 0;
    _contentLabel.font = [UIFont systemFontOfSize:13];
    _contentLabel.textColor = [UIColor grayColor];
    [self.contentView addSubview:_contentLabel];
    
    
}


-(void)setModel:(PKReadDetailModel *)model
{
    _model = model;
    
    
    // 赋值
    self.titleLabel.text = model.title;
    [self.coverImageV sd_setImageWithURL:[NSURL URLWithString:model.coverimg] placeholderImage:nil];
    self.contentLabel.text = model.content;
    
}











- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
